package com.cg.springSecurity.annotation;

import com.cg.springSecurity.valid.TinyIntValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author cg
 * @date 2023/3/30 9:25
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})//只能标注在属性中
@Retention(RetentionPolicy.RUNTIME)//运行时获取
@Documented
@Constraint(validatedBy = {TinyIntValidator.class})
public @interface TinyInt {
    String message() default "{com.cg.springSecurity.TinyInt.message}";

    Class<?>[] groups() default {};//分组校验

    //自定义一些负载信息
    Class<? extends Payload>[] payload() default {};
    int [] vals() default {};
}
